<template>
  <!-- 如果发现 activeName 等于 name 了就显示 -->
  <div class="xtx-tabs-panel" v-show="activeName === name">
    <slot></slot>
  </div>
</template>

<script>
import { inject } from 'vue-demi'
export default {
  name: 'XtxTabsPanel',
  props: {
    label: {
      type: String,
      default: ''
    },
    name: {
      type: String,
      default: ''
    }
  },
  setup() {
    const activeName = inject('activeName')
    return {
      activeName
    }
  }
}
</script>
